
    $(function () {
        var flagPas = false;
        var flagPass = false;
        var passWordForm, passWordForms;
        $("#registerpassword").change(function () {
            passWordForm = $("#registerpassword").val();
            if (passWordForm == "") {
                $("#registerpassword").removeClass("form-control is-valid")
                $("#registerpassword").addClass("form-control is-invalid");
                flagPas = false;
            } else {
                $("#registerpassword").removeClass("form-control is-invalid")
                $("#registerpassword").addClass("form-control is-valid");
                flagPas = true;
            }
        })
        $("#registerrepassword").change(function () {
            passWordForm = $("#registerpassword").val();
            passWordForms = $("#registerrepassword").val();
            if ((passWordForm != passWordForms)) {
                $("#registerrepassword").removeClass("form-control is-valid")
                $("#registerrepassword").addClass("form-control is-invalid");
                flagPass = false;
            } else {
                $("#registerrepassword").removeClass("form-control is-invalid")
                $("#registerrepassword").addClass("form-control is-valid");
                flagPass = true;
            }
        })
        $("#register").click(function () {
            if (flagPas && flagPass) {
                return true;
            } else {
                if (!flagPas) {
                    $("#registerpassword").addClass("form-control is-invalid");
                }
                if (!flagPass) {
                    $("#registerrepassword").addClass("form-control is-invalid");
                }
                return false;
            }
        })
    })